var mongoose =require('mongoose');
var Schema = mongoose.Schema;
/**
 * 人员
 * @type {Schema}
 */
var UserSchema = new Schema({
    name: {type: String}, //名称
    gender: {type: String}, //性别
    email: {type: String}, //email
    age: {type: String}, //年龄
    province: {type: String},
    city: {type: String},
    country: {type: String},
    headimg: {type: String}, //头像
    isBlock: {type:Boolean, default: false}, //锁定

    score: {type: Number, default: 0}, //积分
    level: {type: Number, default: 0}, //等级
    createTime: {type: Date, default: Date.now}, //初始时间
    lastLoginTime: {type: Date, default: Date.now}, //最后登陆时间
    openid: {type: String}, // wechat openid

    card: {type: Schema.Types.ObjectId, ref: 'Card'}, //名片
    permission: {type: Schema.Types.Mixed}, //人脉权限
    factions: [{type: Schema.Types.Mixed}], // 所在圈子
    friends: [{type: Schema.Types.Mixed}] //好友列表 //TODO:abandoned
});

mongoose.model('User', UserSchema);